package com.appstore.dao;

import java.util.List;

import com.appstore.exception.DaoException;
import com.appstore.model.Application;

/**
 * IApplicationDao define some not implemented method to access application
 * data.
 * 
 * @author zhbhun
 * 
 */
public interface IApplicationDao {

	/**
	 * save a new application.
	 * 
	 * @throws DaoException
	 * @throws ConnectionException
	 * 
	 * @throws Exception
	 */
	public void save(Application application) throws DaoException;

	/**
	 * get all application.
	 * 
	 * @return a array of application
	 * @throws DaoException
	 */
	public List<Application> findAll() throws DaoException;

	/**
	 * * find the application by id
	 * 
	 * @param id
	 *            the id of application
	 * @return a application
	 * @throws DaoException
	 */
	public Application findbyId(Integer id) throws DaoException;

	/**
	 * update application
	 * 
	 * @param application
	 * @throws DaoException
	 */
	public void update(Application application) throws DaoException;

	/**
	 * delete application
	 * 
	 * @param id
	 * @throws DaoException
	 */
	public void delete(int id) throws DaoException;

	/**
	 * add download count
	 * 
	 * @param id
	 * @throws DaoException 
	 */
	public void addDownloadCount(int id) throws DaoException;
}
